<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>高级检索</title>
    <link rel="stylesheet" href="../../../layui/css/layui.css">
    <link rel="stylesheet" href="../../../css/coursepage/treeadd.css">
</head>
<body>
<form class="layui-form" lay-filter="formfilter" id="addGoodsForm">
    <div class="layui-form-item">
        <div class="layui-inline" style="margin-top: 38px">
            <div>课程分类:</div>
            <div class="layui-input-inline">
                <input type="tel" id="courseclass" name="classify" lay-verify="required" autocomplete="off" class="layui-input" readonly>
                <button type="button" id="selectadd" class="layui-btn" >选择分类</button>
            </div>
        </div>
        <div class="layui-inline">
            <div>课程名称:</div>
            <div class="layui-input-inline">
                <input type="text" name="name" lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <div>售价:</div>
            <div class="layui-input-inline">
                <input type="tel" name="sale" oninput="this.value=this.value.replace(/[^0-9]/g,'')"; placeholder="只能输入数字" lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <div>上传人员</div>
            <div class="layui-input-inline">
                <input type="text" name="scname" lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <div>课程状态:</div>
            <div class="layui-input-inline">
                <select name="status" lay-verify="required">
                    <option value="">请选择课程状态</option>
                    <option value="1">上架</option>
                    <option value="0">下架</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <div>审核状态:</div>
            <div class="layui-input-inline">
                <select name="auditstatus" required="required">
                    <option value="">请选择审核状态</option>
                    <option value="0">未审核</option>
                    <option value="1">已通过</option>
                    <option value="2">未通过</option>
                </select>
            </div>
        </div>
    </div>
<button id="wancheng" lay-submit="" lay-filter="go" type="button" class="layui-btn">开始检索</button>
<button id="next" class="layui-btn" onclick="resett()">重置</button>
</form>
<script src="../../../js/jquery-3.6.0.js"></script>
<script src="../../../layui/layui.js"></script>
<script>
        layui.use('form', function(){
            var form=layui.form;
            form.on('submit(go)', function(data){
                var data1 = form.val("formfilter");
                parent.gj(data1.classify,data1.name,data1.sale,data1.scname,data1.status,data1.auditstatus);
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            })
            //各种基于事件的操作，下面会有进一步介绍
        });
    function resett(){
        $("#addGoodsForm")[0].reset();
    }
    function selectclass(){
        var treename=localStorage.getItem("treename");
        console.log("----------------------")
        console.log(treename);
        console.log("----------------------")
        $("#courseclass").val(treename);
    }
    $("#selectadd").click(function () {
        layer.open({
            type: 2,
            title: '添加',
            content: "coursetree.html",
            area: ['80%', '80%'],
            end:function (){
                selectclass();
            }
        })
    });
</script>

</body>
</html>
